Dim pgpEncryptorDecryptor As New PgpEncryptorDecryptor() 'Trial Mode
'Dim pgpEncryptorDecryptorLicensed As New PgpEncryptorDecryptor("place user name here", "place license key here") 'License Mode
' we need to generate the keys first if we haven't got them already
Dim username As String = "username"
Dim password As String = "password"
Dim directoryForKeys As String = Directory.GetCurrentDirectory()
Dim publicKeyFilePath As String = Path.Combine(directoryForKeys, "public.asc")
Dim privateKeyFilePath As String = Path.Combine(directoryForKeys, "private.asc")
pgpEncryptorDecryptor.GenerateKeyPairFiles(username, password, publicKeyFilePath, privateKeyFilePath)
'Create a test file
Dim directoryForFiles As String = Directory.GetCurrentDirectory()
Dim inputFilePath As String = Path.Combine(directoryForFiles, "input.txt")
File.WriteAllText(inputFilePath, "This is a test")
Dim encryptedFilePath As String = Path.Combine(directoryForFiles, "encrypted.pgp")
Dim armor As Boolean = True
pgpEncryptorDecryptor.EncryptFile(inputFilePath, encryptedFilePath, publicKeyFilePath, armor)
' decrypt file
Dim decryptedFilePath As String = Path.Combine(directoryForFiles, "decrypted.txt")
pgpEncryptorDecryptor.DecryptFile(encryptedFilePath, decryptedFilePath, privateKeyFilePath, "password")